package com.star.time;

import java.time.Duration;
import java.time.LocalDateTime;

public class DurationTest {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime tomorrow = now.plusDays(1);
        System.out.println(tomorrow);
        long hours1 = Duration.between(tomorrow, now).abs().toHours();
        System.out.println(hours1);
        long hours2 = Duration.between(now, tomorrow).toHours();
        System.out.println(hours2);

    }
}
